UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uOAberVaQOO/8MspckkbMxC0HLWKgnZVXHMbKCNRBu0='
WHERE
key_id = '083f588cd081e2f35f43053a0a2ec501edc748fb00482a6bba4c9b2ee2522bed'
AND (
token = 'uOAberVaQOO/8MspckkbMxC0HLWKgnZVXHMbKCNRBu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)