UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pSi/ie6LB2wrJgNFmcE1hZBGCxKlF9aTGEvx8+SSxYE='
WHERE
key_id = '7862e5de15582f50c09bd0743906b96d6f141f4aee9bf54292f826a71a68df6b'
AND (
token = 'pSi/ie6LB2wrJgNFmcE1hZBGCxKlF9aTGEvx8+SSxYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)