UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P4NmO7Axp940yUa/WJSysVRNOYMzm95AowDZmpnfIwY=' 
WHERE 
  key_id = '68ec5d1acdcec30df9cffcf301967aa707a6e0c14eb284cf113bbad3f89720fe' 
  AND (
    token = 'P4NmO7Axp940yUa/WJSysVRNOYMzm95AowDZmpnfIwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030