UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kAKtcAp9gA0APBAF7wDOoNOudyw1RtO8nnql+XQvrdU='
WHERE
key_id = '425930868faf64f4ecb3d38a2fad6e51c2593591fd8e8ecbadc482079fcdf5cb'
AND (
token = 'kAKtcAp9gA0APBAF7wDOoNOudyw1RtO8nnql+XQvrdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)