UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ksp//CDin2nJ2B+jZyjAh01Pk0XSN0G+PpxSpAy35ik=' 
WHERE 
  key_id = 'b76fc1b455768228de934815f2953a5b830d93a7058e7d09d9d5ab2af7cbc060' 
  AND (
    token = 'ksp//CDin2nJ2B+jZyjAh01Pk0XSN0G+PpxSpAy35ik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041