UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dAT+PptvB3269g+YwcINFZhlMM0/WEMa8sjB5u5zFOQ='
WHERE
key_id = 'b53abf0005f4135f74ee007e0d2516258fccc563ec48069b69e4a91e66148a27'
AND (
token = 'dAT+PptvB3269g+YwcINFZhlMM0/WEMa8sjB5u5zFOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)