UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p+T89LV+3FZQU5nhiIwl3QNuIFkC2vQ27GU37GmBJPY=' 
WHERE 
  key_id = 'bfe9e04df6b8cc456a6cb0249255680569a2ca0866e75fd64a9d753ccf161a2d' 
  AND (
    token = 'p+T89LV+3FZQU5nhiIwl3QNuIFkC2vQ27GU37GmBJPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018