UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vziYSUo9lXP0k2JrdcmLDahe//ojZR+7EeuZY5Ze4Ys='
WHERE
key_id = '0c8658824e49baf91eb7790bd6de42b3ce457201040c5b98ecf0dcfc3ce2f23b'
AND (
token = 'vziYSUo9lXP0k2JrdcmLDahe//ojZR+7EeuZY5Ze4Ys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)