UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uL0pA/DdDmQz4Qqh4wpvzd22JkHNpB1WqQKdCt/tEII='
WHERE
key_id = '1f0ba50af3bd2d0280b5df7e23253eac19a8d822bf626d80052a3548098eca34'
AND (
token = 'uL0pA/DdDmQz4Qqh4wpvzd22JkHNpB1WqQKdCt/tEII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)