UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ohODeO8X0qzm9HPMNaUx8/0H3RTEV95MrmNYZsuNHPQ=' 
WHERE 
  key_id = '15e37313614a749fbb8e741ee45e3c7b470d380ce288a7ea484f7fee185afd8c' 
  AND (
    token = 'ohODeO8X0qzm9HPMNaUx8/0H3RTEV95MrmNYZsuNHPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040