UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '30fyvNDHidE7d0xyZICKrDV2g4MtFdW24DbEcGxFp0s='
WHERE
key_id = '105bfa714db7ab99b1788046bc33829db28151fab3c2a5275f3caa07456a00ef'
AND (
token = '30fyvNDHidE7d0xyZICKrDV2g4MtFdW24DbEcGxFp0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)