UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4NDRHycK+1ztjJFDDKm4+Z6si52mPFfQDB1sLZBVCCo='
WHERE
key_id = '433bbaeb35bfa92520ba7d9add4c4f39e294813856729ac3a7d5228671a23726'
AND (
token = '4NDRHycK+1ztjJFDDKm4+Z6si52mPFfQDB1sLZBVCCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)