UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xpChFT2kRxwxPCRfKR8yH/V7NLFgKhKuIJSTvm53Ef8=' 
WHERE 
  key_id = 'ed9b08e3ce92f7e87f5027d3327b9d6afa5407189abdabe1be9fd11fc8132bf5' 
  AND (
    token = 'xpChFT2kRxwxPCRfKR8yH/V7NLFgKhKuIJSTvm53Ef8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049