UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fXJJlLtR1xxmblpEiG0xzlKnGqp6nUncZZGtE/Awh5I=' 
WHERE 
  key_id = '1432f52ca68ba6df199fe04fa72b410ccf06dc72ebc2b533b7ce9b6609ee3878' 
  AND (
    token = 'fXJJlLtR1xxmblpEiG0xzlKnGqp6nUncZZGtE/Awh5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031