UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pkYxVvqTTyp+jBN37r01qdrpL4sDaM0U1HbZDdBMyXE=' 
WHERE 
  key_id = '7eb6054df039f6fa3ecd780f9f28f7b03747fb179dc947904710a69f956cf20f' 
  AND (
    token = 'pkYxVvqTTyp+jBN37r01qdrpL4sDaM0U1HbZDdBMyXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070