UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nf3UHHIEW6e006Exl3cq2yRX0HCknZdpDN4Nl2exb8E='
WHERE
key_id = 'af775d56d50d375a214ae7445b941ef762de2aaa405e99f3d3671633fbb42bb7'
AND (
token = 'Nf3UHHIEW6e006Exl3cq2yRX0HCknZdpDN4Nl2exb8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)