UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V7IF+2hYqlPmoPb08si40oEYv6+bWaY2z1KI0XNrtWw=' 
WHERE 
  key_id = '2776a9e367f634efb156640deffd8d9c5503389614fddec5671f4cd38a6aa720' 
  AND (
    token = 'V7IF+2hYqlPmoPb08si40oEYv6+bWaY2z1KI0XNrtWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023