UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CJvcu9QTqjd6//5dkjHPbZGrweMAC6Vi/j3+YIHftAg=' 
WHERE 
  key_id = 'abb829ecfdc98b155643f3fac8a844ea2f167f548d8e74aeca2e5129d829b4e3' 
  AND (
    token = 'CJvcu9QTqjd6//5dkjHPbZGrweMAC6Vi/j3+YIHftAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053