UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yXUZYlscItn4PWvbVsALBhs9p7Wo9UC/CbCFfjRZUTY='
WHERE
key_id = 'ebc47ef5b6e11e29f1ee4e73df14d6f2e492ba0bf4fa380f596e9e4283504e0c'
AND (
token = 'yXUZYlscItn4PWvbVsALBhs9p7Wo9UC/CbCFfjRZUTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)