UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VJnz3p2mI37LM9ShivL18JHMCKeNW+XViLi9HHjrrLQ='
WHERE
key_id = 'a5888728f5da045300cbd46eefed81bae62a03f386ba4374350d7d585229876f'
AND (
token = 'VJnz3p2mI37LM9ShivL18JHMCKeNW+XViLi9HHjrrLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)