UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q/oPOHFVxXq8zAGTCisD85QqaM2dX1WPEx85yf+ooQY=' 
WHERE 
  key_id = '6a1858b4b8284530652df28ece91f44def9abcaddca38fe6fd09d6982c6702b1' 
  AND (
    token = 'q/oPOHFVxXq8zAGTCisD85QqaM2dX1WPEx85yf+ooQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029