UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3isyeMY1AMYk9Y0/HI07RCorjLmzR/L52cUHl72cgp0='
WHERE
key_id = 'df1537d2d5b125f1ca56870ffe9b4be3d7a4b1191f0f0581b5edf318f387f114'
AND (
token = '3isyeMY1AMYk9Y0/HI07RCorjLmzR/L52cUHl72cgp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)