UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pSce15uTAe0c5TGCuQp5eiQWDUdFdNz/bROIQciIfcY='
WHERE
key_id = '3a16a7f5339b5165e54a16df6ded8fb5d52a8128932fa20e8e7566f093369538'
AND (
token = 'pSce15uTAe0c5TGCuQp5eiQWDUdFdNz/bROIQciIfcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)