UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'drnu1FzuS8qxXEov5eiDO/MT5xXGBQBynfJP1kV3iqo=' 
WHERE 
  key_id = '00a0d07c9f80850ba18180efac64736e2fea9ab366ded1e082455103016ee30a' 
  AND (
    token = 'drnu1FzuS8qxXEov5eiDO/MT5xXGBQBynfJP1kV3iqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021