UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LU3LDCR80bPURz7e58WrqP6kqHu+i5KhoBpmyBMtnV4=' 
WHERE 
  key_id = 'b57c07dc6552d0645cac0602c02e86313ff8f1665e8a5c1cf5b31fcfaa361c10' 
  AND (
    token = 'LU3LDCR80bPURz7e58WrqP6kqHu+i5KhoBpmyBMtnV4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035