UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's+0KHRKilry0gOSZQTOcGvn9Pj2e7n6pAxk0mXTopYA='
WHERE
key_id = '23ec897ec6395d2622fa63c360a498d00d7736a3bca6e684218ce0601f464e28'
AND (
token = 's+0KHRKilry0gOSZQTOcGvn9Pj2e7n6pAxk0mXTopYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)