UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ji7RyVqlPMHbkdhOpQ6r3OJfA5/D5LDD6Jc1ajgdaC0=' 
WHERE 
  key_id = '9fcb69bb93aefec16fbd124d2b7301a6f6f5d14bd698c4fe3f5f566bcb758d89' 
  AND (
    token = 'Ji7RyVqlPMHbkdhOpQ6r3OJfA5/D5LDD6Jc1ajgdaC0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036