UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aUAZxcUxbiPiS663OyVhOW7CSnCpmBLPMbckpkQ32Jc='
WHERE
key_id = '56e6f77f875a8fc4f0605113554e0f32118dc81ee6bb7f2012e1a5ee9f33da35'
AND (
token = 'aUAZxcUxbiPiS663OyVhOW7CSnCpmBLPMbckpkQ32Jc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)