UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '16TX+Bi31VRdleDOmsb3Pd0QzZO/KIVVSLczTI7h5po='
WHERE
key_id = '0759a752c57510cc32aedaca187d367ed02441cfdc6a451355ee18b1444d665c'
AND (
token = '16TX+Bi31VRdleDOmsb3Pd0QzZO/KIVVSLczTI7h5po='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)