UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mVTO8u1oK5bRfPoyCIKd5UWYM8S9V+tYD2QmLEFteT0='
WHERE
key_id = '1c42db2fca825b34509b71539c17b05618a68c637889a587ada24f5794575420'
AND (
token = 'mVTO8u1oK5bRfPoyCIKd5UWYM8S9V+tYD2QmLEFteT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)