UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0YrzkZhsBKV4oZlNt9izvAbTeZ1dowyFMB4WEPgvaMc='
WHERE
key_id = 'bfebfd6139bd36b3f8310dfe9c0fa42be11859f621d96632c7fb3b94f7457632'
AND (
token = '0YrzkZhsBKV4oZlNt9izvAbTeZ1dowyFMB4WEPgvaMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)